import React from 'react'
import {Pagination} from "antd";
import { IPageNavigiationProps } from '../../interface/IUserList';

export default function PageNavigition(props:IPageNavigiationProps) {
  const pageSizeHandler:(page:number,pageSize:number)=>void=(page,pageSize)=>{
     props.setPage(page);
     props.setSize(pageSize);
  }
  return (
    <Pagination defaultCurrent={props.page} defaultPageSize={props.size} total={props.total} onChange={pageSizeHandler}/>
  )
}
